package admin.gwamok.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import com.gwamok.domain.GwamokCommand;

@Component
public class GwamokDaoImpl extends SqlSessionDaoSupport implements GwamokDao{

	@Override
	public List<GwamokCommand> getjunkongGwamoklist(String gwa_code) {
						
		List<GwamokCommand> list = getSqlSession().selectList("getjunkongGwamoklist", gwa_code);
		
		return list;
	}

	@Override
	public GwamokCommand selectGwamok1(String gwamok_code) {
		
		GwamokCommand gwamok = (GwamokCommand)getSqlSession().selectOne("selectGwamok1",gwamok_code);
		
		return gwamok;
	}
	@Override
	public GwamokCommand selectGwamok(String code) {
		GwamokCommand command = (GwamokCommand)getSqlSession().selectOne("selectGwamok",code);
		return command;
	}
	
	@Override
	public List<GwamokCommand> list(Map<String, Object> map) {
		List<GwamokCommand> list = getSqlSession().selectList("selectList",map);
		return list;
	}
	
	@Override
	public List<GwamokCommand> list() {
		List<GwamokCommand> list = getSqlSession().selectList("selectList");
		return list;
	}

	@Override
	public void insert(GwamokCommand command) {
		getSqlSession().insert("insertGwamok",command);
	}

	@Override
	public void update(GwamokCommand gwamok) {
		getSqlSession().update("updateGwamok",gwamok);
	}

	@Override
	public void delete(String code) {
		getSqlSession().delete("deleteGwamok",code);
	}

	@Override
	public Integer GwamokDup(String code) {
		return getSqlSession().selectOne("GwamokDup",code);
	}


}
